package com.hundsun.fcp.dialog;

import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface.OnCancelListener;

public class LoadingDialog {
	private static ProgressDialog dialog ;
	public static void showLoading(Context context,String message,OnCancelListener cancelListener){
		if(dialog == null){
			dialog = ProgressDialog.show(context, null, message, true, true, cancelListener) ;
			dialog.setCanceledOnTouchOutside(false);
		}
		
		dialog.show() ;
	}
	
	public static void dismiss(){
		if(dialog!=null){
			dialog.dismiss() ;
			dialog = null ;
		}
	}
}
